**********************************************************************************************
* Replication file: "Insiders, outsiders, skills and preferences for social protection: evidence from a survey experiment in Argentina"
* Irene Menéndez González, January 2021
**********************************************************************************************

clear
set more off

use apesw2_ready.dta, clear


* Descriptive statistics
**********************************

* Table A1. Difference in means between treatment and control groups, for covariates used in the analysis.P-values reported in Table A1 are based on t-tests comparing the means of the treatment and control group, for each variable.

table treatment_dual, c(mean gender mean age mean edu mean ses mean dinsider)
table treatment_dual, c(mean union mean ideo mean vote mean client mean provincia)
table treatment_dual, c(mean knowledge)

ttest gender if treatment_dual!=1, by(treatment_dual) // comparing means across control and risk
ttest gender if treatment_dual!=2, by(treatment_dual) // comparing means across control and poverty

ttest age if treatment_dual!=1, by(treatment_dual) // comparing means across control and risk
ttest age if treatment_dual!=2, by(treatment_dual) // comparing means across control and poverty

ttest provincia if treatment_dual!=1, by(treatment_dual) // comparing means across control and risk
ttest provincia if treatment_dual!=2, by(treatment_dual) // comparing means across control and poverty

ttest ses if treatment_dual!=1, by(treatment_dual) // comparing means across control and risk
ttest ses if treatment_dual!=2, by(treatment_dual) // comparing means across control and poverty

ttest dinsider if treatment_dual!=1, by(treatment_dual) // comparing means across control and risk
ttest dinsider if treatment_dual!=2, by(treatment_dual) // comparing means across control and poverty

ttest edu if treatment_dual!=1, by(treatment_dual) // comparing means across control and risk
ttest edu if treatment_dual!=2, by(treatment_dual) // comparing means across control and poverty

ttest union if treatment_dual!=1, by(treatment_dual) // comparing means across control and risk
ttest union if treatment_dual!=2, by(treatment_dual) // comparing means across control and poverty

ttest ideo if treatment_dual!=1, by(treatment_dual) // comparing means across control and risk
ttest ideo if treatment_dual!=2, by(treatment_dual) // comparing means across control and poverty

ttest vote if treatment_dual!=1, by(treatment_dual) // comparing means across control and risk
ttest vote if treatment_dual!=2, by(treatment_dual) // comparing means across control and poverty

ttest client if treatment_dual!=1, by(treatment_dual) // comparing means across control and risk
ttest client if treatment_dual!=2, by(treatment_dual) // comparing means across control and poverty

ttest knowledge if treatment_dual!=1, by(treatment_dual) // comparing means across control and risk
ttest knowledge if treatment_dual!=2, by(treatment_dual) // comparing means across control and poverty
	

* Table A5: difference of means of correlates across two low- and high-skilled insiders

ttest gender if lsi!=1, by(lsi)
ttest age if lsi!=1, by(lsi)
ttest dses if if lsi!=1, by(lsi)
ttest knowledge if lsi!=1, by(lsi)
ttest union if lsi!=1, by(lsi)
ttest dideo if lsi!=1, by(lsi)
ttest vote if lsi!=1, by(lsi)
ttest client if lsi!=1, by(lsi)	


* Regression models
********************************

* Table A2: Effect of labor market group on support for non-contributory over contributory social protection for outsiders (among outsiders, low-skilled insiders and high-skilled insiders (baseline)). 

* Model 1
reg supp1 i.lsi, robust
* Model 2
reg supp1 i.lsi gender age i.provincia, robust	
* Model 3
reg supp1 ib1.lsi, robust
* Model 4
reg supp1 ib1.lsi gender age i.provincia, robust

* Testing for equality of coefficients among different labor-market groups.
reg supp1 i.lsi gender age i.provincia, robust	
regress, coeflegend
test 0.lsi=2.lsi
test 1.lsi=2.lsi
test 1.lsi=0.lsi

* Table A3: Effect of labor market status on support for non-contributory over contributory social protection for outsiders, by skill level.

* Model 1
reg supp1 i.insider##i.sec if insider!=1, robust	
* Model 2
reg supp1 i.insider##i.sec gender age i.provincia if insider!=1, robust	
* Model 3 
reg supp1 i.ioskill gender age i.provincia, robust

* Are low-skilled insiders different from high-skilled insiders?
reg supp1 i.ioskill gender age i.provincia, robust
test 0bn.ioskill=1.ioskill
	
* Are low-skilled insiders different from low-skilled outsiders? 
test 1.ioskill=3.ioskill

* Are high-skilled outsiders different from low-skilled insiders? 
test 1.ioskill=2.ioskill
	

* Table A4: Treatment effect of risk and redistribution primes, by subgroup

* Model 1
reg supp1 i.insider##i.treatment_dual if insider!=1, robust // Without formal self-employed
* Model 2
reg supp1 i.insider##i.treatment_dual gender age i.provincia if insider!=1, robust // Without formal self-employed
* Model 3
reg supp1 i.lsi##i.treatment_dual if lsi!=1, robust // excluding outsiders 
* Model 4
reg supp1 i.lsi##i.treatment_dual gender age i.provincia if lsi!=1, robust

* testing for joint significance

reg supp1 i.lsi##i.treatment_dual, robust
testparm i.lsi##i.treatment_dual

* test whether poverty-exposed outsiders and risk-exposed outsiders are statistically distinguishable:
reg supp1 i.insider##i.treatment_dual gender age i.provincia if insider!=1, robust
regress, coeflegend

test 1.treatment_dual = 2.treatment_dual


* Exporting results
******************************

* Table A2

reg supp1 i.lsi, robust
outreg2 using resultsA2, word replace ctitle(Model 1) dec(3) label

reg supp1 i.lsi gender age i.provincia, robust	
outreg2 using resultsA2, word append ctitle(Model 2) dec(3) label

reg supp1 ib1.lsi, robust
outreg2 using resultsA2, word append ctitle(Model 3) dec(3) label

reg supp1 ib1.lsi gender age i.provincia, robust
outreg2 using resultsA2, word append ctitle(Model 4) dec(3) label

* Table A3 

reg supp1 i.insider##i.sec if insider!=1, robust	
outreg2 using resultsA3, word replace ctitle(Model 1) dec(3) label

reg supp1 i.insider##i.sec gender age i.provincia if insider!=1, robust	
outreg2 using resultsA3, word append ctitle(Model 2) dec(3) label

reg supp1 i.ioskill gender age i.provincia, robust
outreg2 using resultsA3, word append ctitle(Model 3) dec(3) label 

* Table A4 

reg supp1 i.insider##i.treatment_dual if insider!=1, robust 
outreg2 using resultsA4, word replace ctitle(Model 1) dec(3) label 

reg supp1 i.insider##i.treatment_dual gender age i.provincia if insider!=1, robust 
outreg2 using resultsA4, word append ctitle(Model 2) dec(3) label

reg supp1 i.lsi##i.treatment_dual if lsi!=1, robust 
outreg2 using resultsA4, word append ctitle(Model 3) dec(3) label 

reg supp1 i.lsi##i.treatment_dual gender age i.provincia if lsi!=1, robust
outreg2 using resultsA4, word append ctitle(Model 4) dec(3) label


* Figures
********************************

* Figure A1: distribution of responses on support for non-contributory, contributory policy or "neither"

histogram supp, discrete percent gap(50) xscale(range(-.2 2.5)) ///
	ytitle("Mean support for spending on non-registered/registered", margin(small)) yticks(none) ///
	xtitle("") xlabel(0 1 2, valuelabel) ///
	graphregion(color(white) lcolor(white))

* Figure A2: Mean levels of support for non-registered over registered workers

graph bar supp1, over(meansupp, label(labsize(small))) ///
	ytitle("Mean support for non-registered over registered workers", margin(small)) ///
	ylabel(, nogrid labsize(small)) yticks(none) ///
	exclude0 yscale(range(.4 .8)) ///
	graphregion(color(white) lcolor(white)) 

* Figure 1: Mean predicted values of support for non-registered over registered workers, by labor market group (outsiders, low- and high skilled insiders). Based on Model 2 in Table A2.

reg supp1 i.lsi gender age i.provincia, robust
margins lsi
margins lsi, coeflegend post 
marginsplot, recast(bar) plotopts(barwidth(.7)) ///
	title("") ///
	ytitle("Predicted values: support for non-registered over registered workers", margin(small) size(small)) ///
	xtitle("", size(small)) ylabel(, nogrid labsize(small)) yticks(none) ///
	yscale(range(.3 .8)) ///
	graphregion(color(white) lcolor(white)) 	

* In order shown in Figure 1: outsiders, low-skilled and high-skilled insiders	

reg supp1 i.predsupp gender age i.provincia, robust
margins predsupp
margins predsupp, coeflegend post 
marginsplot, recast(bar) plotopts(barwidth(.7)) ///
	title("") ///
	ytitle("Predicted values: support for non-registered over registered workers", margin(small) size(small)) ///
	xtitle("", size(small)) ylabel(, nogrid labsize(small)) yticks(none) ///
	yscale(range(.3 .8)) ///
	graphregion(color(white) lcolor(white)) 

* Figures 2 and 3: code to export main results to excel, to be retrieved using R-code to generate Figures 2 and 3

* Fig. 2(a): treatment among insiders-outsiders, excluding formal self-employed - with controls
reg supp1 i.insider##i.treatment_dual gender age i.provincia if insider!=1, robust 
reg supp1 ib2.insider##i.treatment_dual gender age i.provincia if insider!=1, robust 

** Prepare spreadsheet with estimates
putexcel set "Fig2Estimates.xlsx", sheet("2a") replace
putexcel A1= ("coef.risk")
putexcel B1= ("se.risk")
putexcel C1= ("coef.pov")
putexcel D1= ("se.pov")

** First regression
reg supp1 ib2.insider##i.treatment_dual gender age i.provincia if insider!=1, robust 
regress, coeflegend
*Risk
putexcel A2 = (_b[2.treatment_dual])
putexcel B2 = (_se[2.treatment_dual])

*Poverty
putexcel C2 = (_b[1.treatment_dual])
putexcel D2 = (_se[1.treatment_dual])

** Second regression
reg supp1 i.insider##i.treatment_dual gender age i.provincia if insider!=1, robust 
regress, coeflegend

*Risk
putexcel A3 = (_b[2.treatment_dual])
putexcel B3 = (_se[2.treatment_dual])  
putexcel A4 = (_b[2.insider#2.treatment_dual])
putexcel B4 = (_se[2.insider#2.treatment_dual])
*Poverty
putexcel C3 = (_b[1.treatment_dual])
putexcel D3 = (_se[1.treatment_dual])  
putexcel C4 = (_b[2.insider#1.treatment_dual])
putexcel D4 = (_se[2.insider#1.treatment_dual])


* Fig. 2(b): treatment among low-skill and high-skill insiders, excluding outsiders - with controls
reg supp1 i.lsi##i.treatment_dual gender age i.provincia if lsi!=1, robust
reg supp1 ib2.lsi##i.treatment_dual gender age i.provincia if lsi!=1, robust 

** Prepare spreadsheet with estimates
putexcel set "Fig2Estimates.xlsx", sheet("2b") modify
putexcel A1= ("coef.risk")
putexcel B1= ("se.risk")
putexcel C1= ("coef.pov")
putexcel D1= ("se.pov")

** First regression
reg supp1 ib2.lsi##i.treatment_dual gender age i.provincia if lsi!=1, robust 
regress, coeflegend
* Risk
putexcel A2 = (_b[2.treatment_dual])
putexcel B2 = (_se[2.treatment_dual])

* Poverty
putexcel C2 = (_b[1.treatment_dual])
putexcel D2 = (_se[1.treatment_dual])

**Second regression
reg supp1 i.lsi##i.treatment_dual gender age i.provincia if lsi!=1, robust
regress, coeflegend

* Risk
putexcel A3 = (_b[2.treatment_dual])
putexcel B3 = (_se[2.treatment_dual])  
putexcel A4 = (_b[2.lsi#2.treatment_dual])
putexcel B4 = (_se[2.lsi#2.treatment_dual])
* Poverty
putexcel C3 = (_b[1.treatment_dual])
putexcel D3 = (_se[1.treatment_dual])  
putexcel C4 = (_b[2.lsi#1.treatment_dual])
putexcel D4 = (_se[2.lsi#1.treatment_dual])

* Figure 3: Differential effect of risk and poverty treatment on support for non-contributory over contributory social policy, among other groups. All tests include controls included in baseline models (age, gender, province). Also include education and insider dummies when not testing effect of low-skill insider/low-skill worker. 

** Prepare spreadsheet with estimates
putexcel set "Fig3Estimates.xlsx", sheet("Main") replace
putexcel A1= ("coef.risk")
putexcel B1= ("se.risk")
putexcel C1= ("coef.pov")
putexcel D1= ("se.pov")

* Treatment among low- and high-skilled insiders
reg supp1 i.lsi##i.treatment_dual gender age i.provincia if lsi!=1, robust
regress, coeflegend

putexcel A2 = (_b[2.lsi#2.treatment_dual])
putexcel B2 = (_se[2.lsi#2.treatment_dual])
putexcel C2 = (_b[2.lsi#1.treatment_dual])
putexcel D2 = (_se[2.lsi#1.treatment_dual])

* Treatment among knowledgeable/non-knowledgeable
reg supp1 i.knowledge##i.treatment_dual insider i.edu gender age i.provincia if lsi!=1, robust
regress, coeflegend
putexcel A3 = (_b[1.knowledge#2.treatment_dual])
putexcel B3 = (_se[1.knowledge#2.treatment_dual])
putexcel C3 = (_b[1.knowledge#1.treatment_dual])
putexcel D3 = (_se[1.knowledge#1.treatment_dual])

* Treatment among female/male
reg supp1 i.gender##i.treatment_dual insider i.edu age i.provincia if lsi!=1, robust
regress, coeflegend
putexcel A4 = (_b[1.gender#2.treatment_dual])
putexcel B4 = (_se[1.gender#2.treatment_dual])
putexcel C4 = (_b[1.gender#1.treatment_dual])
putexcel D4 = (_se[1.gender#1.treatment_dual])

* Treatment among older/younger workers
reg supp1 i.dage##i.treatment_dual insider i.edu gender if lsi!=1, robust
regress, coeflegend
putexcel A5 = (_b[1.dage#2.treatment_dual])
putexcel B5 = (_se[1.dage#2.treatment_dual])
putexcel C5 = (_b[1.dage#1.treatment_dual])
putexcel D5 = (_se[1.dage#1.treatment_dual])

* Treatment among low-skilled/high-skilled worker
reg supp1 i.sec##i.treatment_dual insider gender age i.provincia, robust
regress, coeflegend
putexcel A6 = (_b[1.sec#2.treatment_dual])
putexcel B6 = (_se[1.sec#2.treatment_dual])
putexcel C6 = (_b[1.sec#1.treatment_dual])
putexcel D6 = (_se[1.sec#1.treatment_dual])

* Treatment among low/high-income worker
reg supp1 i.dses##i.treatment_dual insider i.edu gender age i.provincia if lsi!=1, robust
regress, coeflegend
putexcel A7 = (_b[1.dses#2.treatment_dual])
putexcel B7 = (_se[1.dses#2.treatment_dual])
putexcel C7 = (_b[1.dses#1.treatment_dual])
putexcel D7 = (_se[1.dses#1.treatment_dual])

* Treatment among high and low-income insiders
reg supp1 i.poorins##i.treatment_dual gender age i.provincia if poorins!=1, robust
regress, coeflegend
putexcel A8 = (_b[2.poorins#2.treatment_dual])
putexcel B8 = (_se[2.poorins#2.treatment_dual])
putexcel C8 = (_b[2.poorins#1.treatment_dual])
putexcel D8 = (_se[2.poorins#1.treatment_dual])

* Treatment among individuals who declare neighbours/themselves as having received favour from candidate/not
reg supp1 i.client##i.treatment_dual insider i.edu gender age i.provincia if lsi!=1, robust
regress, coeflegend
putexcel A9 = (_b[1.client#2.treatment_dual])
putexcel B9 = (_se[1.client#2.treatment_dual])
putexcel C9 = (_b[1.client#1.treatment_dual])
putexcel D9 = (_se[1.client#1.treatment_dual])

* Treatment among those who voted peronist/other
reg supp1 i.vote##i.treatment_dual insider i.edu gender age i.provincia if lsi!=1, robust
regress, coeflegend
putexcel A10 = (_b[1.vote#2.treatment_dual])
putexcel B10 = (_se[1.vote#2.treatment_dual])
putexcel C10 = (_b[1.vote#1.treatment_dual])
putexcel D10 = (_se[1.vote#1.treatment_dual])

* Treatment among union/non-union members
reg supp1 i.union##i.treatment_dual insider i.edu gender age i.provincia if lsi!=1, robust
regress, coeflegend
putexcel A11 = (_b[1.union#2.treatment_dual])
putexcel B11 = (_se[1.union#2.treatment_dual])
putexcel C11 = (_b[1.union#1.treatment_dual])
putexcel D11 = (_se[1.union#1.treatment_dual])

* Treatment among left/right leaning
reg supp1 i.dideo##i.treatment_dual insider i.edu gender age i.provincia if lsi!=1, robust
regress, coeflegend
putexcel A12 = (_b[1.dideo#2.treatment_dual])
putexcel B12 = (_se[1.dideo#2.treatment_dual])
putexcel C12 = (_b[1.dideo#1.treatment_dual])
putexcel D12 = (_se[1.dideo#1.treatment_dual])



* Robustness
******************************

** Figures A3-A12: code to export main results to excel. Except for Figure A3, models in Figures A4-A6 exclude formal self-employed/firm owners in measurement of insiders.

* Prepare spreadsheet with estimates
putexcel set "FigA3A12Estimates.xlsx", sheet("A3") replace
putexcel A1= ("coef.risk")
putexcel B1= ("se.risk")
putexcel C1= ("coef.pov")
putexcel D1= ("se.pov")

* Figure A3
* Treatment among low-skill formal vs. high-skill formal (ie. including formal self-employed/firm-owners in insider measure)
reg supp1 i.lsf##i.treatment_dual gender age i.provincia if lsf!=1, robust
reg supp1 ib2.lsf##i.treatment_dual gender age i.provincia if lsf!=1, robust 

** First regression
reg supp1 ib2.lsf##i.treatment_dual gender age i.provincia if lsf!=1, robust 
regress, coeflegend
* Risk
putexcel A2 = (_b[2.treatment_dual])
putexcel B2 = (_se[2.treatment_dual])

* Poverty
putexcel C2 = (_b[1.treatment_dual])
putexcel D2 = (_se[1.treatment_dual])

** Second regression
reg supp1 i.lsf##i.treatment_dual gender age i.provincia if lsf!=1, robust
regress, coeflegend

* Risk
putexcel A3 = (_b[2.treatment_dual])
putexcel B3 = (_se[2.treatment_dual])  
putexcel A4 = (_b[2.lsf#2.treatment_dual])
putexcel B4 = (_se[2.lsf#2.treatment_dual])
* Poverty
putexcel C3 = (_b[1.treatment_dual])
putexcel D3 = (_se[1.treatment_dual])  
putexcel C4 = (_b[2.lsf#1.treatment_dual])
putexcel D4 = (_se[2.lsf#1.treatment_dual])

* Figure A4
* Treatment among high and low-skill private workers
reg supp1 i.lsp##i.treatment_dual gender age i.provincia, robust
reg supp1 ib2.lsp##i.treatment_dual gender age i.provincia, robust

putexcel set "FigA3A12Estimates.xlsx", sheet("A4") modify
putexcel A1= ("coef.risk")
putexcel B1= ("se.risk")
putexcel C1= ("coef.pov")
putexcel D1= ("se.pov")

** First regression
reg supp1 ib2.lsp##i.treatment_dual gender age i.provincia, robust
regress, coeflegend
* Risk
putexcel A2 = (_b[2.treatment_dual])
putexcel B2 = (_se[2.treatment_dual])

* Poverty
putexcel C2 = (_b[1.treatment_dual])
putexcel D2 = (_se[1.treatment_dual])

** Second regression
reg supp1 i.lsp##i.treatment_dual gender age i.provincia, robust
regress, coeflegend

* Risk
putexcel A3 = (_b[2.treatment_dual])
putexcel B3 = (_se[2.treatment_dual])  
putexcel A4 = (_b[1.lsp#2.treatment_dual])
putexcel B4 = (_se[1.lsp#2.treatment_dual])
* Poverty
putexcel C3 = (_b[1.treatment_dual])
putexcel D3 = (_se[1.treatment_dual])  
putexcel C4 = (_b[1.lsp#1.treatment_dual])
putexcel D4 = (_se[1.lsp#1.treatment_dual])

* Figure A5
* Treatment among high and low-skill public workers
reg supp1 i.lspub1##i.treatment_dual gender age i.provincia if lspub1!=0 & lspub1!=1 & lspub1!=2 & lspub1!=3, robust // low skill public workers support non-contributory benefits
reg supp1 ib2.lspub1##i.treatment_dual gender age i.provincia if lspub1!=0 & lspub1!=1 & lspub1!=2 & lspub1!=3, robust // Same results

putexcel set "FigA3A12Estimates.xlsx", sheet("A5") modify
putexcel A1= ("coef.risk")
putexcel B1= ("se.risk")
putexcel C1= ("coef.pov")
putexcel D1= ("se.pov")

** First regression
reg supp1 ib2.lspub1##i.treatment_dual gender age i.provincia if lspub1!=0 & lspub1!=1 & lspub1!=2 & lspub1!=3, robust
regress, coeflegend

* Risk
putexcel A2 = (_b[2.treatment_dual])
putexcel B2 = (_se[2.treatment_dual])

* Poverty
putexcel C2 = (_b[1.treatment_dual])
putexcel D2 = (_se[1.treatment_dual])

** Second regression
reg supp1 i.lspub1##i.treatment_dual gender age i.provincia if lspub1!=0 & lspub1!=1 & lspub1!=2 & lspub1!=3, robust
regress, coeflegend

* Risk
putexcel A3 = (_b[2.treatment_dual])
putexcel B3 = (_se[2.treatment_dual])  
putexcel A4 = (_b[5.lspub1#2.treatment_dual])
putexcel B4 = (_se[5.lspub1#2.treatment_dual])
* Poverty
putexcel C3 = (_b[1.treatment_dual])
putexcel D3 = (_se[1.treatment_dual])  
putexcel C4 = (_b[5.lspub1#1.treatment_dual])
putexcel D4 = (_se[5.lspub1#1.treatment_dual])

* Figure A6
* Treatment among low-skill workers up to incomplete secondary
reg supp1 i.lsi1##i.treatment_dual gender age i.provincia if lsi!=1, robust
reg supp1 ib2.lsi1##i.treatment_dual gender age i.provincia if lsi!=1, robust 

putexcel set "FigA3A12Estimates.xlsx", sheet("A6") modify
putexcel A1= ("coef.risk")
putexcel B1= ("se.risk")
putexcel C1= ("coef.pov")
putexcel D1= ("se.pov")

** First regression
reg supp1 ib2.lsi1##i.treatment_dual gender age i.provincia if lsi!=1, robust 
regress, coeflegend

* Risk
putexcel A2 = (_b[2.treatment_dual])
putexcel B2 = (_se[2.treatment_dual])

* Poverty
putexcel C2 = (_b[1.treatment_dual])
putexcel D2 = (_se[1.treatment_dual])

** Second regression
reg supp1 i.lsi1##i.treatment_dual gender age i.provincia if lsi!=1, robust
regress, coeflegend

* Risk
putexcel A3 = (_b[2.treatment_dual])
putexcel B3 = (_se[2.treatment_dual])  
putexcel A4 = (_b[2.lsi1#2.treatment_dual])
putexcel B4 = (_se[2.lsi1#2.treatment_dual])
* Poverty
putexcel C3 = (_b[1.treatment_dual])
putexcel D3 = (_se[1.treatment_dual])  
putexcel C4 = (_b[2.lsi1#1.treatment_dual])
putexcel D4 = (_se[2.lsi1#1.treatment_dual])

* Figure A7
* Treatment among respondents with high and low levels of political knowledge.
reg supp1 i.knowledge##i.treatment_dual insider i.edu gender age i.provincia if lsi!=1, robust
reg supp1 ib2.knowledge##i.treatment_dual insider i.edu gender age i.provincia if lsi!=1, robust 

putexcel set "FigA3A12Estimates.xlsx", sheet("A7") modify
putexcel A1= ("coef.risk")
putexcel B1= ("se.risk")
putexcel C1= ("coef.pov")
putexcel D1= ("se.pov")

** First regression
reg supp1 ib2.knowledge##i.treatment_dual insider i.edu gender age i.provincia if lsi!=1, robust 
regress, coeflegend

* Risk
putexcel A2 = (_b[2.treatment_dual])
putexcel B2 = (_se[2.treatment_dual])

* Poverty
putexcel C2 = (_b[1.treatment_dual])
putexcel D2 = (_se[1.treatment_dual])

** Second regression
reg supp1 i.knowledge##i.treatment_dual insider i.edu gender age i.provincia if lsi!=1, robust
regress, coeflegend

* Risk
putexcel A3 = (_b[2.treatment_dual])
putexcel B3 = (_se[2.treatment_dual])  
putexcel A4 = (_b[1.knowledge#2.treatment_dual])
putexcel B4 = (_se[1.knowledge#2.treatment_dual])
* Poverty
putexcel C3 = (_b[1.treatment_dual])
putexcel D3 = (_se[1.treatment_dual])  
putexcel C4 = (_b[1.knowledge#1.treatment_dual])
putexcel D4 = (_se[1.knowledge#1.treatment_dual])

* Figure A8
* Treatment among individuals who declare neighbours or themselves as having received favour from candidate/not as proxy for clientelism 
reg supp1 i.client##i.treatment_dual insider i.edu gender age i.provincia if lsi!=1, robust
reg supp1 ib2.client##i.treatment_dual insider i.edu gender age i.provincia if lsi!=1, robust
 
putexcel set "FigA3A12Estimates.xlsx", sheet("A8") modify
putexcel A1= ("coef.risk")
putexcel B1= ("se.risk")
putexcel C1= ("coef.pov")
putexcel D1= ("se.pov")
 
** First regression
reg supp1 ib2.client##i.treatment_dual insider i.edu gender age i.provincia if lsi!=1, robust
regress, coeflegend

* Risk
putexcel A2 = (_b[2.treatment_dual])
putexcel B2 = (_se[2.treatment_dual])

* Poverty
putexcel C2 = (_b[1.treatment_dual])
putexcel D2 = (_se[1.treatment_dual])

** Second regression
reg supp1 i.client##i.treatment_dual insider i.edu gender age i.provincia if lsi!=1, robust
regress, coeflegend

* Risk
putexcel A3 = (_b[2.treatment_dual])
putexcel B3 = (_se[2.treatment_dual])  
putexcel A4 = (_b[1.client#2.treatment_dual])
putexcel B4 = (_se[1.client#2.treatment_dual])
* Poverty
putexcel C3 = (_b[1.treatment_dual])
putexcel D3 = (_se[1.treatment_dual])  
putexcel C4 = (_b[1.client#1.treatment_dual])
putexcel D4 = (_se[1.client#1.treatment_dual])
 
* Figure A9
* Treatment among those with positive and negative evaluations of Cristina Fernández de Kirchner’s government
reg supp1 i.cris##i.treatment_dual insider i.edu gender age i.provincia if lsi!=1, robust
reg supp1 ib2.cris##i.treatment_dual insider i.edu gender age i.provincia if lsi!=1, robust 

putexcel set "FigA3A12Estimates.xlsx", sheet("A9") modify
putexcel A1= ("coef.risk")
putexcel B1= ("se.risk")
putexcel C1= ("coef.pov")
putexcel D1= ("se.pov")

** First regression
reg supp1 ib2.cris##i.treatment_dual insider i.edu gender age i.provincia if lsi!=1, robust 
regress, coeflegend

* Risk
putexcel A2 = (_b[2.treatment_dual])
putexcel B2 = (_se[2.treatment_dual])

* Poverty
putexcel C2 = (_b[1.treatment_dual])
putexcel D2 = (_se[1.treatment_dual])

** Second regression
reg supp1 i.cris##i.treatment_dual insider i.edu gender age i.provincia if lsi!=1, robust
regress, coeflegend

* Risk
putexcel A3 = (_b[2.treatment_dual])
putexcel B3 = (_se[2.treatment_dual])  
putexcel A4 = (_b[1.cris#2.treatment_dual])
putexcel B4 = (_se[1.cris#2.treatment_dual])
* Poverty
putexcel C3 = (_b[1.treatment_dual])
putexcel D3 = (_se[1.treatment_dual])  
putexcel C4 = (_b[1.cris#1.treatment_dual])
putexcel D4 = (_se[1.cris#1.treatment_dual])

* Figure A10
* Treatment among insiders with positive and negative evaluations of personal economic situation
reg supp1 i.poorins2##i.treatment_dual gender age ses i.provincia if poorins2!=1, robust 
reg supp1 ib2.poorins2##i.treatment_dual gender age ses i.provincia if poorins2!=1, robust 

putexcel set "FigA3A12Estimates.xlsx", sheet("A10") modify
putexcel A1= ("coef.risk")
putexcel B1= ("se.risk")
putexcel C1= ("coef.pov")
putexcel D1= ("se.pov")

** First regression
reg supp1 ib2.poorins2##i.treatment_dual gender age ses i.provincia if poorins2!=1, robust 
regress, coeflegend

* Risk
putexcel A2 = (_b[2.treatment_dual])
putexcel B2 = (_se[2.treatment_dual])

* Poverty
putexcel C2 = (_b[1.treatment_dual])
putexcel D2 = (_se[1.treatment_dual])

** Second regression
reg supp1 i.poorins2##i.treatment_dual gender age ses i.provincia if poorins2!=1, robust 
regress, coeflegend

* Risk
putexcel A3 = (_b[2.treatment_dual])
putexcel B3 = (_se[2.treatment_dual])  
putexcel A4 = (_b[2.poorins2#2.treatment_dual])
putexcel B4 = (_se[2.poorins2#2.treatment_dual])
* Poverty
putexcel C3 = (_b[1.treatment_dual])
putexcel D3 = (_se[1.treatment_dual])  
putexcel C4 = (_b[2.poorins2#1.treatment_dual])
putexcel D4 = (_se[2.poorins2#1.treatment_dual])

* Figure A11
* Treatment among low- and high-skilled insiders, controlling for union membership
reg supp1 i.lsi##i.treatment_dual gender age union i.provincia if lsi!=1, robust
reg supp1 ib2.lsi##i.treatment_dual gender age union i.provincia if lsi!=1, robust 

putexcel set "FigA3A12Estimates.xlsx", sheet("A11") modify
putexcel A1= ("coef.risk")
putexcel B1= ("se.risk")
putexcel C1= ("coef.pov")
putexcel D1= ("se.pov")

** First regression
reg supp1 ib2.lsi##i.treatment_dual gender age union i.provincia if lsi!=1, robust 
regress, coeflegend

* Risk
putexcel A2 = (_b[2.treatment_dual])
putexcel B2 = (_se[2.treatment_dual])

* Poverty
putexcel C2 = (_b[1.treatment_dual])
putexcel D2 = (_se[1.treatment_dual])

** Second regression
reg supp1 i.lsi##i.treatment_dual gender age union i.provincia if lsi!=1, robust
regress, coeflegend

* Risk
putexcel A3 = (_b[2.treatment_dual])
putexcel B3 = (_se[2.treatment_dual])  
putexcel A4 = (_b[2.lsi#2.treatment_dual])
putexcel B4 = (_se[2.lsi#2.treatment_dual])
* Poverty
putexcel C3 = (_b[1.treatment_dual])
putexcel D3 = (_se[1.treatment_dual])  
putexcel C4 = (_b[2.lsi#1.treatment_dual])
putexcel D4 = (_se[2.lsi#1.treatment_dual])


* Figure A12
* Treatment among low- and high-skilled insiders, controlling for income
reg supp1 i.lsi##i.treatment_dual gender age ses i.provincia if lsi!=1, robust
reg supp1 ib2.lsi##i.treatment_dual gender age ses i.provincia if lsi!=1, robust 

putexcel set "FigA3A12Estimates.xlsx", sheet("A12") modify
putexcel A1= ("coef.risk")
putexcel B1= ("se.risk")
putexcel C1= ("coef.pov")
putexcel D1= ("se.pov")

** First regression
reg supp1 ib2.lsi##i.treatment_dual gender age ses i.provincia if lsi!=1, robust 
regress, coeflegend

* Risk
putexcel A2 = (_b[2.treatment_dual])
putexcel B2 = (_se[2.treatment_dual])

* Poverty
putexcel C2 = (_b[1.treatment_dual])
putexcel D2 = (_se[1.treatment_dual])

** Second regression
reg supp1 i.lsi##i.treatment_dual gender age ses i.provincia if lsi!=1, robust
regress, coeflegend

* Risk
putexcel A3 = (_b[2.treatment_dual])
putexcel B3 = (_se[2.treatment_dual])  
putexcel A4 = (_b[2.lsi#2.treatment_dual])
putexcel B4 = (_se[2.lsi#2.treatment_dual])
* Poverty
putexcel C3 = (_b[1.treatment_dual])
putexcel D3 = (_se[1.treatment_dual])  
putexcel C4 = (_b[2.lsi#1.treatment_dual])
putexcel D4 = (_se[2.lsi#1.treatment_dual])




